<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                template="/templates/template.xhtml">
    <ui:define name="title">短信用户定义</ui:define>
    <ui:define name="content">
        <h:form>
            <div class="topbar clearfix" style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar id="buttonToolBar">
                    <f:facet name="right">
                        <p:commandButton value="保存" icon="fa fa-save"
                                         actionListener="#{smsUserDefinitionBean.onSave}" update="@form"/>
                        <p:commandButton value="重置" icon="fa fa-refresh"
                                         actionListener="#{smsUserDefinitionBean.onReset}"
                                         process="@this"
                                         update="@form"/>
                        <p:button value="返回" icon="fa fa-reply-all" href="#{currentUserBean.back}"></p:button>
                    </f:facet>
                </p:toolbar>
            </div>

            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card ui-g-12">
                            <div class="ui-g-1">
                                <h:outputLabel value="用户定义"/>
                            </div>
                            <div class="ui-g-11">
                                <p:selectOneMenu value="#{smsUserDefinitionBean.selectedSmsUserDefinitionId}"
                                                 filter="true"
                                                 filterMatchMode="contains">
                                    <p:ajax listener="#{smsUserDefinitionBean.onSelectSmsUserDefinition}"
                                            update="@form"/>
                                    <f:selectItem itemLabel="" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{smsUserDefinitionBean.smsUserDefinitions}"
                                            var="smsUserDefinition"
                                            itemLabel="#{smsUserDefinition.name}"
                                            itemValue="#{smsUserDefinition.id}"/>
                                </p:selectOneMenu>
                            </div>
                        </div>
                        <div class="card ui-g-12">
                            <div class="ui-g-12">
                                <h3><b>定义信息</b></h3>
                            </div>
                            <div class="ui-g-1">
                                定义名称
                            </div>
                            <div class="ui-g-11">
                                <p:inputText value="#{smsUserDefinitionBean.smsUserDefinition.name}"/>
                            </div>
                        </div>
                        <div class="card ui-g-12">
                            <div class="ui-g-12">
                                <h3><b>基本信息</b></h3>
                            </div>
                            <div class="ui-g-1">
                                芝麻分
                            </div>
                            <div class="ui-g-5">
                                <div class="input-group" style="width: 47%; float: left;">
                                    <span class="input-group-addon">最低</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.minSesamePoint}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">分</span>
                                </div>
                                <span style="float:left;padding-top:5px;">—</span>
                                <div class="input-group" style="width: 47%; float:left;">
                                    <span class="input-group-addon">最高</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.maxSesamePoint}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">分</span>
                                </div>
                            </div>
                            <div class="ui-g-1">
                                意向金额
                            </div>
                            <div class="ui-g-5">
                                <div class="input-group" style="width: 47%; float: left;">
                                    <span class="input-group-addon">最低</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.minAmount}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                                <span style="float:left;padding-top:5px;">—</span>
                                <div class="input-group" style="width: 47%; float:left;">
                                    <span class="input-group-addon">最高</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.maxAmount}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                            <div class="ui-g-1">
                                月收入
                            </div>
                            <div class="ui-g-5">
                                <div class="input-group" style="width: 47%; float: left;">
                                    <span class="input-group-addon">最低</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.minIncome}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                                <span style="float:left;padding-top:5px;">—</span>
                                <div class="input-group" style="width: 47%; float:left;">
                                    <span class="input-group-addon">最高</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.maxIncome}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">元</span>
                                </div>
                            </div>
                            <div class="ui-g-1">
                                年龄
                            </div>
                            <div class="ui-g-5">
                                <div class="input-group" style="width: 47%; float: left;">
                                    <span class="input-group-addon">最低</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.minAge}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">周岁</span>
                                </div>
                                <span style="float:left;padding-top:5px;">—</span>
                                <div class="input-group" style="width: 47%; float:left;">
                                    <span class="input-group-addon">最高</span>
                                    <p:inputNumber value="#{smsUserDefinitionBean.$.maxAge}"
                                                   decimalPlaces="0"/>
                                    <span class="input-group-addon">周岁</span>
                                </div>
                            </div>
                            <div class="ui-g-1">
                                性别
                            </div>
                            <div class="ui-g-5">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.sex}">
                                    <f:selectItem itemLabel="男" itemValue="男,先生"/>
                                    <f:selectItem itemLabel="女" itemValue="女,女士"/>
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                </p:selectManyButton>
                            </div>
                            <div class="ui-g-1">
                                婚姻状态
                            </div>
                            <div class="ui-g-5">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.marriage}">
                                    <f:selectItem itemLabel="已婚" itemValue="已婚,已婚已育,已婚未育"/>
                                    <f:selectItem itemLabel="未婚" itemValue="未婚"/>
                                    <f:selectItem itemLabel="离异" itemValue="离异"/>
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                </p:selectManyButton>
                            </div>
                            <div class="ui-g-1">
                                信用卡
                            </div>
                            <div class="ui-g-5">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.credit}">
                                    <f:selectItem itemLabel="有" itemValue="有"/>
                                    <f:selectItem itemLabel="没有" itemValue="no,没有"/>
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                </p:selectManyButton>
                            </div>
                            <div class="ui-g-1">
                                社保
                            </div>
                            <div class="ui-g-5">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.socialInsurance}">
                                    <f:selectItem itemLabel="有" itemValue="是"/>
                                    <f:selectItem itemLabel="没有" itemValue="没有"/>
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                </p:selectManyButton>
                            </div>
                            <div class="ui-g-1">
                                住房公积金
                            </div>
                            <div class="ui-g-5">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.houseFund}">
                                    <f:selectItem itemLabel="有" itemValue="是"/>
                                    <f:selectItem itemLabel="没有" itemValue="没有"/>
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                </p:selectManyButton>
                            </div>
                            <div class="ui-g-1">
                                车辆状态
                            </div>
                            <div class="ui-g-5">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.hasCar}">
                                    <f:selectItem itemLabel="有" itemValue="有车"/>
                                    <f:selectItem itemLabel="没有" itemValue="没有"/>
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                </p:selectManyButton>
                            </div>
                            <div class="ui-g-1">
                                房产状态
                            </div>
                            <div class="ui-g-5">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.hasHouse}">
                                    <f:selectItem itemLabel="有" itemValue="有房"/>
                                    <f:selectItem itemLabel="没有" itemValue="没有"/>
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                </p:selectManyButton>
                            </div>
                            <div class="ui-g-2">
                                公司名称包含"有限公司"
                            </div>
                            <div class="ui-g-4">
                                <p:selectOneButton value="#{smsUserDefinitionBean.$.containsLimitationCompany}">
                                    <f:selectItem itemLabel="是" itemValue="baseInfo.containsLimitationCompany"/>
                                </p:selectOneButton>
                            </div>
                            <div class="ui-g-1">
                                职业身份
                            </div>
                            <div class="ui-g-11">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.profession}">
                                    <f:selectItem itemLabel="没填写" itemValue="没填写"/>
                                    <f:selectItem itemLabel="上班族" itemValue="上班族"/>
                                    <f:selectItem itemLabel="个体户" itemValue="个体户"/>
                                    <f:selectItem itemLabel="企业主" itemValue="企业主"/>
                                    <f:selectItem itemLabel="学生" itemValue="学生"/>
                                    <f:selectItem itemLabel="自由职业" itemValue="自由职业"/>
                                    <f:selectItem itemLabel="其他" itemValue="其他"/>
                                </p:selectManyButton>
                            </div>
                        </div>
                        <div class="card ui-g-12">
                            <div class="ui-g-12">
                                <h3><b>剔除黑户</b></h3>
                            </div>
                            <div class="ui-g-12">
                                <p:selectManyButton value="#{smsUserDefinitionBean.$.eliminateBlackList}">
                                    <f:selectItems
                                            value="#{smsUserDefinitionBean.dictionaries[DictionaryCode.SMS_ELIMINATE_BLACK_LIST]}"
                                            var="dic"
                                            itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                                </p:selectManyButton>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>